<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>A使用js创建虚拟DOM.html</title>
</head>
<body>

<div id="test">

</div>

<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>

<script type="text/javascript">
    /*const vDom = React.createElement(
            "h1", {id:"title"},"hello,react"
    )*/
    const vDom = React.createElement(
            "h1", {id:"title"},
            React.createElement("span",{},"hello,react")
    )

    // 渲染虚拟Dom
    ReactDOM.render(vDom, document.getElementById("test"))
</script>
</body>
</html>